﻿@{
    ViewBag.Title = "XemChiTietLoaiSanPham";
    Layout = "~/Views/Shared/_LayoutWebmini.cshtml";
    var loaisp = (Model.Object.LoaiSanPham)ViewBag.loaisp;
    var sanpham = (List<Model.Object.SanPham>)ViewBag.dssanpham;
}

  <!-- breadcrumbs BOF -->
                    <div class="breadcrumbs">
                        <ul>
                            <li class="home">
                                <a href="@Url.Action("Index","Home")" title="Tới trang chủ">Trang chủ</a>
                                <span></span>
                            </li>
                            <li class="category127">
                                <strong>@loaisp.Ten_Loai</strong>
                            </li>
                        </ul>
                    </div>
                    <!-- breadcrumbs EOF -->
                    <div class="col-main">

                       

                        <div id="fb-root"></div>
                        <script>(function (d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) { return; }
    js = d.createElement(s); js.id = id;
    js.src = "../connect.facebook.net/en_US/all.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
                        <div class="category-products">
                            <div class="toolbar">
                                <div class="sorter">


                                    <div class="sort-by toolbar-switch">
                                        <div class="toolbar-title">
                                            <label>Sắp xếp theo</label>
                                            <span class="current">Vị trí</span>
                                            <select onchange="setLocation(this.value)">
                                                <option selected="selected" value="dac-san15ee.html?dir=asc&amp;order=position">Vị trí</option>
                                                <option value="dac-san79f7.html?dir=asc&amp;order=name">Tên</option>
                                                <option value="dac-san6973.html?dir=asc&amp;order=price">Giá</option>
                                            </select>
                                        </div>
                                        <div class="toolbar-dropdown">
                                            <ul>
                                                <li class="selected"><a href="dac-san15ee.html?dir=asc&amp;order=position">Vị trí</a></li>
                                                <li><a href="dac-san79f7.html?dir=asc&amp;order=name">Tên</a></li>
                                                <li><a href="dac-san6973.html?dir=asc&amp;order=price">Giá</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="sort-order">
                                        <a href="dac-san00ea.html?dir=desc&amp;order=position" title="Set Descending Direction">
                                            <img src="skin/frontend/shopper/default/images/i_asc_arrow.gif" width="27" height="27" alt="Set Descending Direction" class="v-middle" /></a>
                                    </div>

                                    <p class="view-mode">
                                        <label>View as</label>
                                        <strong title="Grid" class="grid">Grid</strong>
                                        <a href="dac-sana927.html?mode=list" title="Danh sách" class="list">Danh sách</a>
                                    </p>

                                    <div class="limiter toolbar-switch">
                                        <div class="toolbar-title">
                                            <label>Xem</label>
                                            <span class="current">30</span>
                                            <select onchange="setLocation(this.value)">
                                                <option value="dac-sana8ac.html?limit=9">9</option>
                                                <option value="dac-san30e0.html?limit=15">15</option>
                                                <option value="dac-san05ff.html?limit=20">20</option>
                                                <option selected="selected" value="dac-san675c.html?limit=30">30</option>
                                            </select>
                                            mỗi trang           
                                        </div>
                                        <div class="toolbar-dropdown">
                                            <ul>
                                                <li><a href="dac-sana8ac.html?limit=9">9</a></li>
                                                <li><a href="dac-san30e0.html?limit=15">15</a></li>
                                                <li><a href="dac-san05ff.html?limit=20">20</a></li>
                                                <li class="selected"><a href="dac-san675c.html?limit=30">30</a></li>
                                            </ul>
                                        </div>
                                    </div>


                                </div>

                                <div class="pager">

                                    <p class="amount">
                                        <strong>@sanpham.Count mặt hàng</strong>
                                    </p>








                                </div>
                            </div>

                            <ul class="products-grid one_column_5">
                       
                            @for (int i = 0; i < sanpham.Count; i++)
                            {
                                if (sanpham[i].ID_Loaisanpham == loaisp.ID)
                                {
                                    if (sanpham[i].HinhAnhs != null)
                                    {
                            <li class="item">

                                <div class="regular">
                                    <a href="@Url.Action("XemChiTietSanPham", "Home", new
                                        {
                                            id = sanpham[i].ID,
                                            loaisp = Nongsan.StringUils.UrlRewrite(loaisp.Ten_Loai),
                                            tensp = Nongsan
                                                .StringUils.UrlRewrite(sanpham[i].Ten)
                                        })" title="@sanpham[i].Ten" class="product-image">
                                        <img src="@sanpham[i].HinhAnhs.FirstOrDefault().ImagePath" data-srcx2="@sanpham[i].HinhAnhs.FirstOrDefault().ImagePath" width="252" height="252" alt="@sanpham[i].Ten" />
                                    </a>
                                    <div class="product-info">
                                        <div class="button-container">
                                            <p>
                                                <button type="button" title="Thêm vào giỏ" class="button btn-cart ajax-cart"  onclick="javascript: getsp(@sanpham[i].ID);"><span><span>Thêm vào giỏ</span></span></button>
                                            </p>
                                        </div>
                                        <a class="product-name" href="@Url.Action("XemChiTietSanPham", "Home", new
                                                                 {
                                                                     id = sanpham[i].ID,
                                                                     loaisp = Nongsan.StringUils.UrlRewrite(loaisp.Ten_Loai),
                                                                     tensp = Nongsan
                                                                         .StringUils.UrlRewrite(sanpham[i].Ten)
                                                                 })" title="@sanpham[i].Ten">@sanpham[i].Ten</a>



                                        <div class="price-box">
                                            <span class="regular-price" id="product-price-"+ @sanpham[i].ID>
                                                <span class="price">@sanpham[i].Gia đ</span><span class='unit-price'>/@sanpham[i].Don_vi_tinh</span>                                                            </span>

                                        </div>

                                    </div>
                                </div>

                                <div class="hover">
                                    <a href="@Url.Action("XemNhanhChiTietSanPham", "Home", new { id = sanpham[i].ID })" data-fancybox-group="gallery" class='fancybox quick-view' id='fancybox_@sanpham[i].ID'>Xem nhanh</a>
                                    <a href="@Url.Action("XemChiTietSanPham", "Home", new
                                        {
                                            id = sanpham[i].ID,
                                            loaisp = Nongsan.StringUils.UrlRewrite(loaisp.Ten_Loai),
                                            tensp = Nongsan
                                                .StringUils.UrlRewrite(sanpham[i].Ten)
                                        })" title="@sanpham[i].Ten" class="product-image">
                                        <img src="@sanpham[i].HinhAnhs.FirstOrDefault().ImagePath" width="252" height="252" alt="@sanpham[i].Ten" />
                                    </a>
                                    <a href="#" title="@sanpham[i].Ten">



                                        <div class="price-box">
                                            <span class="regular-price" id="product-price-3050">
                                                <span class="price">@sanpham[i].Gia đ</span><span class='unit-price'>/@sanpham[i].Don_vi_tinh</span>                                                            </span>

                                        </div>

                                    </a>
                                    <a class="product-name" href="@Url.Action("XemChiTietSanPham", "Home", new
                                                             {
                                                                 id = sanpham[i].ID,
                                                                 loaisp = Nongsan.StringUils.UrlRewrite(loaisp.Ten_Loai),
                                                                 tensp = Nongsan
                                                                     .StringUils.UrlRewrite(sanpham[i].Ten)
                                                             })" title="@sanpham[i].Ten">@sanpham[i].Ten</a>

                                    <div class="button-container">


                                        <p>
                                            <button type="button" title="Thêm vào giỏ" class="button btn-cart ajax-cart"  onclick="javascript: getsp(@sanpham[i].ID);"><span><span><em></em>Thêm vào giỏ</span></span></button>
                                        </p>


                                    </div>

                                    <span class="ajax_loading" id='ajax_loading3050'>
                                        <img src='skin/frontend/shopper/default/images/ajax-loader.gif' /></span>

                                </div>

                            </li>
                                    }
                                }
                            }
                        
                        
                    </ul>
                    

                           

                            <div class="toolbar-bottom">
                                <div class="toolbar">
                                    <div class="sorter">


                                        <div class="sort-by toolbar-switch">
                                            <div class="toolbar-title">
                                                <label>Sắp xếp theo</label>
                                                <span class="current">Vị trí</span>
                                                <select onchange="setLocation(this.value)">
                                                    <option selected="selected" value="dac-san15ee.html?dir=asc&amp;order=position">Vị trí</option>
                                                    <option value="dac-san79f7.html?dir=asc&amp;order=name">Tên</option>
                                                    <option value="dac-san6973.html?dir=asc&amp;order=price">Giá</option>
                                                </select>
                                            </div>
                                            <div class="toolbar-dropdown">
                                                <ul>
                                                    <li class="selected"><a href="dac-san15ee.html?dir=asc&amp;order=position">Vị trí</a></li>
                                                    <li><a href="dac-san79f7.html?dir=asc&amp;order=name">Tên</a></li>
                                                    <li><a href="dac-san6973.html?dir=asc&amp;order=price">Giá</a></li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="sort-order">
                                            <a href="dac-san00ea.html?dir=desc&amp;order=position" title="Set Descending Direction">
                                                <img src="skin/frontend/shopper/default/images/i_asc_arrow.gif" width="27" height="27" alt="Set Descending Direction" class="v-middle" /></a>
                                        </div>

                                        <p class="view-mode">
                                            <label>View as</label>
                                            <strong title="Grid" class="grid">Grid</strong>
                                            <a href="dac-sana927.html?mode=list" title="Danh sách" class="list">Danh sách</a>
                                        </p>

                                        <div class="limiter toolbar-switch">
                                            <div class="toolbar-title">
                                                <label>Xem</label>
                                                <span class="current">30</span>
                                                <select onchange="setLocation(this.value)">
                                                    <option value="dac-sana8ac.html?limit=9">9</option>
                                                    <option value="dac-san30e0.html?limit=15">15</option>
                                                    <option value="dac-san05ff.html?limit=20">20</option>
                                                    <option selected="selected" value="dac-san675c.html?limit=30">30</option>
                                                </select>
                                                mỗi trang           
                                            </div>
                                            <div class="toolbar-dropdown">
                                                <ul>
                                                    <li><a href="dac-sana8ac.html?limit=9">9</a></li>
                                                    <li><a href="dac-san30e0.html?limit=15">15</a></li>
                                                    <li><a href="dac-san05ff.html?limit=20">20</a></li>
                                                    <li class="selected"><a href="dac-san675c.html?limit=30">30</a></li>
                                                </ul>
                                            </div>
                                        </div>


                                    </div>

                                    <div class="pager">

                                        <p class="amount">
                                            <strong>@sanpham.Count mặt hàng</strong>
                                        </p>








                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
